package com20230218;

    class Person {
    public int id;
    public String name;
    public char gender;

        public static void change(Person p){
            p.gender = (p.gender == '男'?'男':'女');


        }

        public static void main(String[] args) {
            Person p = new Person();
            p.id = 1001;
            p.name = "林志玲";
            p.gender = '女';
            change(p);
            System.out.println(p.gender);
        }

}
